<?php 
define('IN_ECS', true);
 
require(dirname(__FILE__) . '/includes/init.php');
require_once(ROOT_PATH . 'languages/' .$_CFG['lang']. '/long.php');
// print_r($_LANG);
if ((DEBUG_MODE & 2) != 2)
{
    $smarty->caching = true;
}

$cache_id = sprintf('%X', crc32($_SESSION['user_rank'] . '-' . $_CFG['lang']));

if (!$smarty->is_cached('long.dwt', $cache_id))
{
	$time = time();
	$smarty->assign(array('time'=>$time));
	$test='<b>天气晴朗，阳光明媚</b>';//变量调节器
    $smarty->assign('test',$test);
    $smarty->assign('sex',0);
    setcookie('aaa','wd');
    $arr1=array(
        'one'=>'天气晴朗',
        'two'=>'阳光明媚',
        'three'=>'碧空万里无云',
    );

    $smarty->assign('arr1',$arr1);
    $smarty->assign('lang',$_LANG);
    $smarty->assign('arr2',array('php','mysql'));


    $sql = "select * from ".$ecs->table('goods')." limit 5";
    $goods = $db->getAll($sql);
    $smarty->assign('goods',$goods);
    // print_r($goods);
}else{

}
// print_r(json_decode('{"name":"demo","num1":"22","num2":"33"}',true));

$smarty->assign('flash_data',get_banner());
print_r(get_banner());
function get_banner()
{
    $data=simplexml_load_file(ROOT_PATH.'/data/flash_data.xml');
    $arr=array();
    foreach($data->item as $v){
        // print_r($v);
        $a=(array)$v;
        $arr[]=$a['@attributes'];
    }
    return $arr;
}

$smarty->display('long.dwt', $cache_id);



 ?>
